package com.leaves.common.publicmethod.methods;

import com.leaves.mapper.*;
import com.leaves.service.AuthInfoService;
import com.leaves.service.DeptInfoService;
import com.leaves.service.RoleInfoService;
import com.leaves.service.UserInfoService;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.annotation.Resource;

/**
 * @Author: LEAVES
 * @Version 1.0
 * @Date: 2021年08月21日 15时08分44秒
 * @Description:
 */
@Component
public class MapperUtil {

    private MapperUtil mapperUtil;

    /**
     * ----------------------Mapper---------------------
     */
    @Resource
    public UserInfoMapper userInfoMapper;
    @Resource
    public RoleInfoMapper roleInfoMapper;
    @Resource
    public AuthInfoMapper authInfoMapper;
    @Resource
    public UserRoleMapper userRoleMapper;
    @Resource
    public RoleAuthMapper roleAuthMapper;
    @Resource
    public DeptInfoMapper deptInfoMapper;

    /**
     * ----------------------Service---------------------
     */
    @Resource
    public UserInfoService userInfoService;
    @Resource
    public RoleInfoService roleInfoService;
    @Resource
    public AuthInfoService authInfoService;
    @Resource
    public DeptInfoService deptInfoService;

    @PostConstruct
    private void init() {
        mapperUtil = this;
        /**
         * ----------------------Mapper---------------------
         */
        mapperUtil.userInfoMapper = this.userInfoMapper;
        mapperUtil.userInfoService = this.userInfoService;
        mapperUtil.roleInfoMapper = this.roleInfoMapper;
        mapperUtil.roleInfoService = this.roleInfoService;
        mapperUtil.authInfoMapper = this.authInfoMapper;
        mapperUtil.deptInfoMapper = this.deptInfoMapper;

        /**
         * ----------------------Service---------------------
         */
        mapperUtil.authInfoService = this.authInfoService;
        mapperUtil.userRoleMapper = this.userRoleMapper;
        mapperUtil.roleAuthMapper = this.roleAuthMapper;
        mapperUtil.deptInfoService = this.deptInfoService;
    }
}
